package com.ruyuan.dfs.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 请求类型
 *
 * @author Sun Dasheng
 */
@Getter
@AllArgsConstructor
public enum PacketType {

    /**
     * 请求类型
     */

    TRANSFER_FILE(6, "文件传输的二进制包类型"),
    GET_FILE(11, "客户端从DataNode下载文件，或DataNode之间相互同步副本请求");

    public int value;
    private String description;

    public static PacketType getEnum(int value) {
        for (PacketType packetType : values()) {
            if (packetType.getValue() == value) {
                return packetType;
            }
        }
        return null;
    }
}